﻿<%@ Page Language="C#" MasterPageFile="~/TrangChu.Master" AutoEventWireup="true"
    CodeBehind="Baithi.aspx.cs" Inherits="DOAN.Baithi" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<%--<meta http-equiv="refresh" content="<%=seconds%>;url=home.aspx">--%>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="content-right">
        <div class="register">
            <asp:Label ID="lblLoi" runat="server" Text=""> </asp:Label>
        </div>
        <div class="register">
            <asp:Label ID="Label2" runat="server" Text="Chon Mon"> </asp:Label>
            <asp:DropDownList ID="drpMon" runat="server"></asp:DropDownList><br />
            <asp:Label ID="Label3" runat="server" Text="Nhap Ma DT"> </asp:Label>
            <asp:TextBox ID="txtma" runat="server"></asp:TextBox><br />
            <asp:Button ID="btbegin" runat="server" Text="BatDau" onclick="btbegin_Click" />
        </div>
        
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Enabled="False" 
            Interval="100000">
        </asp:Timer>
        <asp:UpdatePanel ID="updatdfdfepn" runat="server">   
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel ID="pnTT" Visible="false" runat="server" >
            <div class="register">
            <%-- <asp:Label runat="server" ID="lblkequa" Text="Ket qua"></asp:Label>--%>
            <span class="font_time fs20 fb cl3">
                <asp:Label runat="server" ID="lblttkequa"> Thông tin thí sinh và đề thi</asp:Label></span><br />
            <div class="text_box2">
                <span class="fb">Họ tên: </span>
                <asp:Label ID="lblTT_hoten" runat="server" Text=""> </asp:Label>
            </div>
            <div class="text_box2">
                <asp:Label ID="lbTG" runat="server"> Phut</asp:Label>
            </div>
            <div class="text_box2">
                <span class="marl10 fb">Số câu đúng: </span>
                <asp:Label ID="lblTT_Socaudung" runat="server" Text=""> </asp:Label>
            </div>
            <br />
            <div class="register">
                <div class="text_box2">
                    <span class="fb">Môn thi: </span>
                    <asp:Label ID="lblTT_monthi" runat="server" Text=""> </asp:Label>
                </div>
                <div class="text_box2">
                    <div id="timelabel"></div></span>
                </div>
                <div>
                    <span class="marl10 fb">Số điểm đạt được: </span>
                    <asp:Label ID="lblTT_Sodiem" runat="server" Text=""></asp:Label>
                </div>
                <asp:Label ID="lbda" runat="server"></asp:Label>
            </div>
        </div>
            </asp:Panel>
            <div class="register mart22">
                <asp:LinkButton ID="btXemdapan" Visible="false" runat="server" Text=" Xem đáp án" />
            </div>
        <asp:Panel ID="pnthi" runat="server">          
            <div class="register mart22">
                <asp:DataList ID="dtCauhoi" runat="server" Style="margin-right: 448px" Width="436px">
                    <EditItemStyle BackColor="#FF3399" BorderColor="#CC3399" BorderStyle="Dotted" BorderWidth="1px" />
                    <ItemTemplate>
                        <span class="fb fs16">
                            <asp:Label ID="Label1" runat="server">Câu <%#Eval("STT") %> <%# Container.ItemIndex+1 %> </asp:Label></span> <span class="fb fs16">
                                <asp:Label ID="lblsocau" runat="server" Text=" "></asp:Label></span><br />
                        <asp:Image ImageUrl='<%#Eval("Image") %>' runat="server" Width="100px" Height="100px" /><br />
                        <%--<asp:Label runat="server" ID="lblCauhoi"><span class="mart22"><a href='<%#"Luyenthi.aspx?id=Made" + Eval("Macauhoi") %>'></a> <%#Eval("Noidung")%></span></asp:Label><br />--%>
                        <asp:Label Text='<%#Eval("Noidung") %>' runat="server"></asp:Label><br />
                        <span class="marl10">
                            <asp:RadioButton ID="Rd1" runat="server" Checked="true" GroupName="TL" AutoPostBack="false" Text='<%#DataBinder.Eval(Container.DataItem,"DapanA") %>' />
                        </span>
                        <br />
                        <span class="marl10">
                            <asp:RadioButton ID="Rd2" runat="server" GroupName="TL" AutoPostBack="false" Text='<%#DataBinder.Eval(Container.DataItem,"DapanB") %>' />
                        </span>
                        <br />
                        <span class="marl10">
                            <asp:RadioButton ID="Rd3" runat="server" GroupName="TL" AutoPostBack="false" Text='<%#DataBinder.Eval(Container.DataItem,"DapanC") %>' />
                        </span>
                        <br />
                        <span class="marl10">
                            <asp:RadioButton ID="Rd4" runat="server" GroupName="TL" AutoPostBack="false" Text='<%#DataBinder.Eval(Container.DataItem,"DapanD") %>' />
                        </span>
                        <br />
                        <span class="marl10 cl4">
                            <asp:Label runat="server" ID="lbltrue" Visible="false" Text='<%#DataBinder.Eval(Container.DataItem,"Phuongandung") %>'></asp:Label>
                        </span>
                        <br />
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <div class="register mart10">
                <asp:Button ID="btNopbai" Visible="false" runat="server" Text="Nộp bài" OnClick="btoke_Click" OnClientClick="stop()" />
            </div>
        </asp:Panel>
        </ContentTemplate>
                
        
        </asp:UpdatePanel>
    </div>
    
    <script type="text/javascript">
    var leave =<%=seconds %>;
    
    
    CounterTimer();
    var interv=setInterval(CounterTimer,1000);
    function CounterTimer()
    {
    
    if(leave==0)
    {  
//      alert("thoi gian da het");
    }
    
    else{
    var day = Math.floor(leave / ( 60 * 60 * 24))
    var hour = Math.floor(leave / 3600)-(day * 24)
    var minute = Math.floor(leave / 60)- (day * 24 *60)-(hour * 60)
    var second = Math.floor(leave)-(day * 24 *60*60)- (hour * 60 * 60)-(minute*60)
    hour=hour<10 ? "0" + hour : hour;
    minute=minute<10 ? "0"+ minute : minute;
    second=second<10 ? "0" + second : second;
    var remain=hour + ":"+minute+":"+second;
    leave=leave-1;
    document.getElementById("timelabel").innerHTML="<b>Thời gian còn lại:</b>" +remain;
    }
    
    }
   
//Test 


    </script>
</asp:Content>
